using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Vin.Extension.Redis.Cache;
using Vin.Tool.AspNetCore.Singleton;

namespace Vin.Extension.Framework.Base;

public abstract class VinBackgroundService : Tool.AspNetCore.Service.VinBackgroundService
{
    protected RedisCache RedisCache => RedisCacheManager.GetRedisCache();
}
// public abstract class VinBackgroundService : BackgroundService
// {
//     protected RedisCache RedisCache => RedisCacheManager.GetRedisCache();
//
//     protected ILogger Logger =>
//         VinApp.GetRequiredService<ILoggerFactory>().CreateLogger(this.GetType());
//
//     protected virtual string LoggerName => this.GetType().Name;
//
//     public VinBackgroundService()
//     {
//         VinApp.Inject(this);
//     }
// }